#define PHASE(x) ((int)(floor (4 * (x + 0.125)) - 4 * floor (x + 0.125)))
gboolean
-gsk_gl_glyph_cache_lookup (GskGLGlyphCache *cache,
- PangoFont *font,
- PangoGlyph glyph,
- float x,
- float y,
- float scale,
- GskGLDriver *driver,
- GskGLCachedGlyph *cached_glyph_out)
+gsk_gl_glyph_cache_lookup (GskGLGlyphCache *cache,
+ PangoFont *font,
+ PangoGlyph glyph,
+ float x,
+ float y,
+ float scale,
+ GskGLDriver *driver,
+ const GskGLCachedGlyph **cached_glyph_out)
{
GskGLCachedGlyph *value;
guint xshift = PHASE (x);
value->draw_height * key->scale / 1024 > 0)
add_to_cache (cache, key, driver, value);
- *cached_glyph_out = *value;
+ *cached_glyph_out = value;
g_hash_table_insert (cache->hash_table, key, value);
}
else
{
- *cached_glyph_out = *value;
+ *cached_glyph_out = value;
}
- return cached_glyph_out->atlas != NULL;
+ return (*cached_glyph_out)->atlas != NULL;
}
void
for (i = 0; i < num_glyphs; i++)
{
const PangoGlyphInfo *gi = &glyphs[i];
- GskGLCachedGlyph glyph;
+ const GskGLCachedGlyph *glyph;
float glyph_x, glyph_y, glyph_w, glyph_h;
float tx, ty, tx2, ty2;
double cx;
&glyph);
/* e.g. whitespace */
- if (glyph.draw_width <= 0 || glyph.draw_height <= 0)
+ if (glyph->draw_width <= 0 || glyph->draw_height <= 0)
goto next;
- if (glyph.texture_id == 0)
+ if (glyph->texture_id == 0)
goto next;
- ops_set_texture (builder, glyph.texture_id);
+ ops_set_texture (builder, glyph->texture_id);
- tx = glyph.tx;
- ty = glyph.ty;
- tx2 = tx + glyph.tw;
- ty2 = ty + glyph.th;
+ tx = glyph->tx;
+ ty = glyph->ty;
+ tx2 = tx + glyph->tw;
+ ty2 = ty + glyph->th;
- glyph_x = floor (x + cx + 0.125) + glyph.draw_x;
- glyph_y = floor (y + cy + 0.125) + glyph.draw_y;
- glyph_w = glyph.draw_width;
- glyph_h = glyph.draw_height;
+ glyph_x = floor (x + cx + 0.125) + glyph->draw_x;
+ glyph_y = floor (y + cy + 0.125) + glyph->draw_y;
+ glyph_w = glyph->draw_width;
+ glyph_h = glyph->draw_height;
ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) {
{ { glyph_x, glyph_y }, { tx, ty }, },